Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deprecation

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deprecation

Log a deprecation message with stack

  • 2.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is deprecation?

The `deprecation` npm package is designed to help developers manage and signal deprecations within their codebase. It provides a structured way to mark certain functionalities as deprecated, issue warnings, and guide users towards alternatives or updated practices. This can be particularly useful in libraries or applications undergoing gradual upgrades or changes, ensuring backward compatibility while encouraging the adoption of new features or methods.

What are deprecation's main functionalities?

Emitting Deprecation Warnings

This feature allows developers to emit deprecation warnings with a unique ID and a message guiding users towards an alternative method or practice. The code sample demonstrates how to create a new `Deprecation` instance associated with a specific package and issue a warning about a deprecated method.

"use strict";
const Deprecation = require('deprecation');

const deprecation = new Deprecation('@mycompany/mypackage');

deprecation.warn('deprecated-method', 'The `deprecatedMethod()` is deprecated and will be removed in the next major release. Use `newMethod()` instead.');

Other packages similar to deprecation

Keywords

FAQs

Package last updated on 13 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc